package com.example.daxiguaforharmony.slice;

import com.example.daxiguaforharmony.ResourceTable;
import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.content.Intent;
import ohos.aafwk.content.IntentParams;
import ohos.aafwk.content.Operation;
import ohos.agp.components.Button;
import ohos.agp.components.webengine.WebView;
import ohos.agp.window.service.WindowManager;
import ohos.bundle.AbilityInfo;

/**
 * Full screen ability slice
 */
public class PrivacyAbilitySlice extends AbilitySlice {
    @Override
    public void onStart(Intent intent) {
        super.onStart(intent);

        // hide status bar
        this.getWindow().addFlags(WindowManager.LayoutConfig.MARK_ALLOW_EXTEND_LAYOUT);
        this.getWindow().addFlags(WindowManager.LayoutConfig.MARK_FULL_SCREEN);

        this.setUIContent(ResourceTable.Layout_privacy);

        WebView webView = (WebView) findComponentById(ResourceTable.Id_webInst);
        if (webView != null) {
            System.out.println("webview is ok===");
            webView.load("http://it360.org.cn/privacy.html");

        } else {
            System.out.println("webview is null===");
            //btnOk.setText("OK1");
        }


    }

    @Override
    protected void onOrientationChanged(AbilityInfo.DisplayOrientation displayOrientation) {
        super.onOrientationChanged(displayOrientation);
    }

    @Override
    public void onActive() {
        super.onActive();
    }

    @Override
    public void onForeground(Intent intent) {
        super.onForeground(intent);
    }
}
